#include "TanMetaObject.h"
#include <iostream>

class A
{
public:
    TanSignal<int, const char*> signal;

    void function(int a, const char* str){
        printf("function slot:%d, %s\n", a, str);
    }
};

class B
{
public:
    void function1(int a, const char* str){
        printf("class B slot:%d, %s\n", a, str);
    }
};

class C
{
public:
    void function2(int a, const char* str){
        printf("class C slot:%d, %s\n", a, str);
    }
};

int main(void)
{
    A a; B b; C c;
    connect(&a.signal, &a, &A::function);
    connect(&a.signal, &b, &B::function1);
    connect(&a.signal, &c, &C::function2);
    a.signal.emit(111, "123");

    printf("**********\n");

    disconnect(&a.signal, &c, &C::function2);
    a.signal.emit(123, "abc");

    return 0;
}
